Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

(fix) - Fix internal and graphcache/extras main path #733

Merged
merged 4 commits into from
Apr 21, 2020
Merged

Conversation

JoviDeCroock
Copy link
Collaborator

@JoviDeCroock JoviDeCroock commented Apr 21, 2020

Make the extension unknown so it can decide for itself what it likes the most, this is similar to https://github.com/FormidableLabs/urql/blob/master/packages/core/package.json#L21

Fixes: #732

@JoviDeCroock JoviDeCroock requested a review from kitten April 21, 2020 17:40
@changeset-bot
Copy link

changeset-bot bot commented Apr 21, 2020

🦋 Changeset is good to go

Latest commit: 73d2f3f

We got this.

This PR includes changesets to release 2 packages
Name Type
@urql/core Patch
@urql/exchange-graphcache Patch

Not sure what this means? Click here to learn what changesets are.

Click here if you're a maintainer who wants to add another changeset to this PR

@kitten kitten changed the title Fix main path (fix) - Fix @urql/core/internal and @urql/exchange-graphcache/extras main path Apr 21, 2020
@OriginalEXE
Copy link

Hi, I am having problems with 1.9.7 and it seems like this might solve it, just wondering if you think it will, or should I open a new issue?

Error: No valid exports main found for '/Users/ante/Projects/MarkerHero-Website/node_modules/@urql/core'
    at resolveExportsTarget (internal/modules/cjs/loader.js:611:9)
    at applyExports (internal/modules/cjs/loader.js:492:14)
    at resolveExports (internal/modules/cjs/loader.js:541:12)
    at Function.Module._findPath (internal/modules/cjs/loader.js:643:22)
    at Function.Module._resolveFilename (internal/modules/cjs/loader.js:941:27)
    at Function.Module._load (internal/modules/cjs/loader.js:847:27)
    at Module.require (internal/modules/cjs/loader.js:1016:19)
    at require (internal/modules/cjs/helpers.js:69:18)
    at Object.<anonymous> (/Users/ante/Projects/MarkerHero-Website/node_modules/urql/dist/urql.js:1:12)
    at Module._compile (internal/modules/cjs/loader.js:1121:30)
    at Module._extensions..js (internal/modules/cjs/loader.js:1160:10)
    at Object.require.extensions.<computed> [as .js] (/Users/ante/Projects/MarkerHero-Website/node_modules/ts-node/src/index.ts:832:44)
    at Module.load (internal/modules/cjs/loader.js:976:32)
    at Function.Module._load (internal/modules/cjs/loader.js:884:14)
    at Module.require (internal/modules/cjs/loader.js:1016:19)
    at require (internal/modules/cjs/helpers.js:69:18) {
  code: 'MODULE_NOT_FOUND'
}

Thanks

@JoviDeCroock
Copy link
Collaborator Author

JoviDeCroock commented Apr 21, 2020

@OriginalEXE you can make sure by trying out the build: @urql/core: "https://pkg.csb.dev/FormidableLabs/urql/commit/73d2f3f8/@urql/core"

@OriginalEXE
Copy link

Thanks. How would I make sure that I am using that package? I don't have @urql/core dependency in my project, only urql directly.

I did try downloading the package from your url and replacing the node_modules/@urql/core contents with it, but that did not work so not sure if that's not valid, or maybe my issue is unrelated to the one that you are trying to solve here.

Thanks

Copy link
Contributor

@wgolledge wgolledge left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Would the urql/core exports need this change as well?

@JoviDeCroock
Copy link
Collaborator Author

No, the purpose of this is to support webpack @wgolledge

The problem is, for node to switch to modular resolving it needs the mjs extension, however webpack hates this extension so we leave this open so it can decide to fill it in for itself.

@kitten kitten changed the title (fix) - Fix @urql/core/internal and @urql/exchange-graphcache/extras main path (fix) - Fix internal and graphcache/extras main path Apr 21, 2020
@kitten kitten merged commit 78629bf into master Apr 21, 2020
@kitten kitten deleted the fix-main-path branch April 21, 2020 20:42
@kitten
Copy link
Member

kitten commented Apr 21, 2020

That's published as @urql/[email protected]. If you're affected, a quick yarn upgrade @urql/core (or the same in npm of course) should do the trick.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Can't import the named export 'makeFetchBody' from non EcmaScript module (only default export is available)
4 participants